package com.example.ch02xyzonecom.controller;

import com.example.ch02xyzonecom.config.UserContext;
import com.example.ch02xyzonecom.pojo.SysUser;
import com.example.ch02xyzonecom.vo.ResultJson;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/***
 * @title MainController
 * @description <description class purpose>
 * @author WeiShuo
 * @version 1.0.0
 * @create 2023/9/20 19:26
 **/
@Controller
public class MainController {

//    @GetMapping("/")
//    String index(){
//        return  "index";
//    }

    @ResponseBody
    @GetMapping("/user/info")
    ResultJson getUser(){
        return ResultJson.success(UserContext.getUser());
    }

}
